package com.hdoit.ares.web.cust.wechat;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.hdoit.ares.logical.cust.service.ICustCollectionService;
import com.hdoit.ares.logical.cust.service.ICustFootprintService;
import com.tennetcn.component.wechat.BaseWechat;

@Controller
@RequestMapping("/wechat/cust/colAndFoot/")
public class CollectionAndFootprintWechat extends BaseWechat{

	private ICustCollectionService custCollectionService;
	
	public ICustCollectionService getCustCollectionService() {
		return custCollectionService;
	}

	@Resource
	public void setCustCollectionService(
			ICustCollectionService custCollectionService) {
		this.custCollectionService = custCollectionService;
	}

	private ICustFootprintService custFootprintService;
	
	public ICustFootprintService getCustFootprintService() {
		return custFootprintService;
	}
	
	@Resource
	public void setCustFootprintService(ICustFootprintService custFootprintService) {
		this.custFootprintService = custFootprintService;
	}

	@Override
	public String getRoutePath() {
		
		return "areas/wechat/cust/colAndFoot/";
	}
	
/*	private final String collectAndFootprintViewName = "collectIndex";
	private final String collectAndFootprintListViewName = "collectAndFootprintList";
	private final String collectListViewName = "collectList";
	private final String footprintListViewName = "footprintList";*/
	private final String collectionViewName = "collection";/*我的收藏*/
	private final String footprintViewName = "footprint";/*我的足迹*/
	
	@RequestMapping(value = collectionViewName,method = { RequestMethod.GET, RequestMethod.POST})
	public String collection(Model model){
		
		return view(collectionViewName);
	}
	
	@RequestMapping(value = footprintViewName,method = { RequestMethod.GET, RequestMethod.POST})
	public String footprint(Model model){
		
		return view(footprintViewName);
	}
	
/*	@RequestMapping(value = collectAndFootprintViewName,method = { RequestMethod.GET, RequestMethod.POST})
	public String collect(Model model){
		
		return view(collectAndFootprintViewName);
	}*/
	
	/*@RequestMapping(value=collectAndFootprintListViewName,method = {RequestMethod.GET,RequestMethod.POST})
	public String searchCollection(Model model,String menuType,String contentType){
		WechatLoginModel loginModel = wechatSession.getCurrentLogin();
		model.addAttribute("loginModel", loginModel);
		Customer customer  = (Customer)loginModel.get(AresManageContainer.customer_account_info);
		
		if("收藏".equals(menuType)){
			List<MyCollection> collections = custCollectionService.selectCollectionByType(contentType, customer.getId());
			model.addAttribute("collections", collections);
			return view(collectListViewName);
		}else if("足迹".equals(menuType)){
			List<MyFootprint>footprints = custFootprintService.selectFootprints(contentType, customer.getId());
			model.addAttribute("footprints", footprints);
			return view(footprintListViewName);
		}
		 
		return null;
		
	}*/
}

